package com.zdpx.pxframework.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zdpx.pxframework.system.entity.UserDepartment;
import com.zdpx.pxframework.system.mapper.UserDepartmentMapper;
import com.zdpx.pxframework.system.service.UserDepartmentService;
import org.springframework.stereotype.Service;


/**
 * 用户部门关联信息 服务实现类
 *
 * @Description:
 * @Author: Cheng XiaoXiao
 * @Date: 2022-02-27 15:20:14
 */
@Service
public class UserDepartmentServiceImpl extends ServiceImpl<UserDepartmentMapper, UserDepartment> implements UserDepartmentService {
    /**
     * 获取用户部门关联详情
     *
     * @param id ID
     * @return 单个用户部门关联详情
     */
    @Override
    public UserDepartment detailById(String id) {
        return this.getById(id);
    }

    /**
     * 增加用户部门关联信息
     *
     * @param userDepartment 用户部门关联对象
     */
    @Override
    public void saveUserDepartment(UserDepartment userDepartment) {
        this.baseMapper.insert(userDepartment);
    }

    /**
     * 修改用户部门关联信息
     *
     * @param userDepartment 用户部门关联对象
     */
    @Override
    public void updateUserDepartmentById(UserDepartment userDepartment) {
        this.baseMapper.updateById(userDepartment);
    }

    /**
     * 根据ID删除
     *
     * @param id ID
     */
    @Override
    public void deleteById(String id) {
        this.removeById(id);
    }
}
